package com.ltt.service.impl;

import com.ltt.dao.pojo.Market;
import com.ltt.dao.pojo.Order;
import com.ltt.dao.vo.OrderVo;
import com.ltt.mapper.MarketMapper;
import com.ltt.service.MarketService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @author ‘李天泰’
 * @version 1.0
 * @description: TODO
 * @date 2023/5/5 15:37
 */
@Service
public class MarketServiceImpl implements MarketService {
    @Autowired
    private MarketMapper marketMapper;

    @Override
    public List<Market> getAllMarket() {
        return marketMapper.getAllMarket();
    }

    @Override
    public Market getMarket(int id) {
        return marketMapper.getMarket(id);
    }

    @Override
    public void buyMarket(Order order) {
        marketMapper.buyMarket(order);
    }

    @Override
    public List<OrderVo> findAllOrderById(String openid) {
        return marketMapper.findAllOrderById(openid);
    }
}
